<template>
  <div class="task">
    <div class="header">
      <span><Pencil fill="#69bb06" /> 我的待办</span>
      <span class="more">更多<ArrowRight /> </span>
    </div>
    <ul class="task-list">
      <li v-for="item in list">
        <div class="name">
          <el-avatar :size="30" src="http://comicui.cn/image/avatar.png" />
          <span>{{ item.name }}</span>
        </div>
        <div class="matter">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Officiis, provident. Dolor illo veritatis reiciendis
          quos!
        </div>
        <div class="time">{{ item.time }}</div>
      </li>
    </ul>
  </div>
</template>

<script setup lang="ts">
import { Pencil, ArrowRight } from '@icon-park/vue-next';

const list = [
  {
    name: '史萱',
    time: '刚刚'
  },
  {
    name: '景鸿',
    time: '30分钟前'
  },
  {
    name: '宫昌淼',
    time: '5小时前'
  },
  {
    name: '景鸿',
    time: '5小时前'
  },
  {
    name: '空曜曦',
    time: '15小时前'
  }
];
</script>

<style scoped lang="scss">
.header {
  width: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  border-bottom: 1px solid var(--admin-border-color);
  font-size: 14px;
}
.more {
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #999999;

  &:hover {
    color: var(--el-color-primary);
  }
}

.task-list {
  all: unset;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  margin-bottom: -1px;
  margin-right: -1px;

  li {
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--admin-border-color);
    border-right: 1px solid var(--admin-border-color);

    .name {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 14px;
    }

    .matter {
      margin-top: 10px;
      font-size: 13px;
      color: #999999;
    }

    .time {
      margin-top: auto;
      display: flex;
      justify-content: flex-end;
      font-size: 12px;
      padding-top: 10px;
      color: #999999;
    }
  }
}
</style>
